
//convert(arg1,arg2);
.box{
    width: convert(10cm,px);
}

@size:20;
@w:10px;
@h:10rem;

.body{
    width: unit(10mm,px);
    height: unit(100,px);
    font-size: unit(@size+1,cm);
    padding: @w+@h;
    margin:unit(@w+@h,em);
}

#d1:after{
	content:replace("welcome to itany.","o","O");
	content:replace("welcome to itany.","o","O",g);
	content:replace("this is string.","(string)","new $1"); //$1是占位符，表示第1个匹配值
	content:replace("welcome to nanjing.","^welcome to nanjing.$","aa");
}

//length()函数
@names1:"tom","jack","alice";
@names2:"tom" "jack" "alice" "mike";
@str:"aabbcc";
#d1{
	font-size:unit(length(@names1),rem);
	font-size:unit(length(@names2),rem);
    font-size:unit(length(@str),rem);
}

//extract()函数
@myBorder:2px solid red;
#d2{
	border: @myBorder;
	color:extract(@myBorder,3); //提取第3个字段
	font-size: unit(extract(@myBorder,1),rem);
}
